package org.stu.tp.dao;

import java.util.List;

import org.hibernate.Session;
import org.stu.tp.dto.Email;
import org.stu.tp.util.HibernateUtil;

public class EmailDao {
	@SuppressWarnings("unchecked")
	public static Email getEmail(String recordName){
		Email email=new Email();
		Session session = HibernateUtil.currentSession();
		List <Email> userList=session.createSQLQuery("select * from email where RecordName="+"'"+recordName+"'").addEntity(Email.class).list();
		email=userList.get(0);
		HibernateUtil.closeSession();
		return email;
	}
}
